<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Constants;


use Hyperf\Constants\AbstractConstants;
use Hyperf\Constants\Annotation\Constants;

/**
 * 调用方式：HttpStatus::getMessage(HttpStatus::HTTP_NO_CONTENT)
 * @Constants()
 * */
class HttpStatus extends AbstractConstants
{
    /**
     * @Message("成功")
     */
    const HTTP_SUCCESS = 20000;

    /**
     * @Message("无内容返回")
     */
    const HTTP_NO_CONTENT = 20040;

    /**
     * @Message("失败")
     */
    const HTTP_FAIL = 40000;

    /**
     * @Message("请登录")
     */
    const HTTP_AUTH_FAIL = 40010;

    /**
     * @Message("权限不足")
     */
    const HTTP_FORBIDDEN = 40030;

    /**
     * @Message("页面不存在")
     */
    const HTTP_NOT_FOUND = 40040;

    /**
     * @Message("请求方式错误")
     */
    const HTTP_METHOD_NOT_ALLOWED = 40050;

    /**
     * @Message("无法满足请求")
     */
    const HTTP_NOT_ACCEPTABLE = 40060;

    /**
     * @Message("请求超时")
     */
    const HTTP_REQUEST_TIMEOUT = 40080;

    /**
     * @Message("资源已过期")
     */
    const HTTP_GONE = 40100;

    /**
     * @Message("请求条件不满足")
     */
    const HTTP_PRECONDITION_FAILED = 40120;

    /**
     * @Message("资源类型无效")
     */
    const HTTP_UNSUPPORTED_MEDIA_TYPE = 40150;

    /**
     * @Message("网络错误")
     */
    const HTTP_INTERNAL_SERVER_ERROR = 50000;

    /**
     * @Message("无法识别请求")
     */
    const HTTP_NOT_IMPLEMENTED = 50010;

    const HTTP_STATUS = [
        self::HTTP_SUCCESS => '成功',
        self::HTTP_NO_CONTENT => '无内容返回',
        self::HTTP_FAIL => '失败',
        self::HTTP_AUTH_FAIL => '请登录',
        self::HTTP_FORBIDDEN => '权限不足',
        self::HTTP_NOT_FOUND => '页面不存在',
        self::HTTP_METHOD_NOT_ALLOWED => '请求方式错误',
        self::HTTP_NOT_ACCEPTABLE => '无法满足请求',
        self::HTTP_REQUEST_TIMEOUT => '请求超时',
        self::HTTP_GONE => '资源已过期',
        self::HTTP_PRECONDITION_FAILED => '请求条件不满足',
        self::HTTP_UNSUPPORTED_MEDIA_TYPE => '资源类型无效',
        self::HTTP_INTERNAL_SERVER_ERROR => '网络错误',
        self::HTTP_NOT_IMPLEMENTED => '无法识别请求'
    ];
}
